import React, { Component } from 'react';
class Search extends Component {
  constructor(props) {
    super(props);
  }
  state = { 
    name:''
   }

  //内容输入
  content2 =(e)=>{
    // console.log(e);
    this.setState({
      name: e.target.value
    })
  } 

  // 确认按钮
  affirm =()=>{
    let {name} = this.state
    this.props.todolist({name})
  }

  render() { 
    return ( 
      <>
        <div className='top'>
          <h1 className='h1'>拾忆记事本</h1>
          <div className='jilu'>记录生活点点滴滴，写下生活每一个美好</div>
          <div className='inp'>
            <div className='nei'>内容</div>
            <input className='input3' type="text" value={this.state.nmae} onChange={this.content2} />
            <div className='nei2' onClick={()=>this.affirm(this.state)}>确认</div>
          </div>
        </div>
      </>
     );
  }
}
 
export default Search;